class User < ActiveRecord::Base
	validates_presence_of :name, :message => "is required"
	validates_uniqueness_of :name
	before_save :set_key

  private
  
	def set_key
	  self.key = Digest::MD5.hexdigest((object_id + rand(255)).to_s)
	end
end
